package com.apartment.own.service.impl;

import java.util.List;
import com.apartment.common.utils.DateUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.apartment.own.mapper.OwnResHouseRoomConfMapper;
import com.apartment.own.domain.OwnResHouseRoomConf;
import com.apartment.own.service.IOwnResHouseRoomConfService;

/**
 * 房间配置Service业务层处理
 * 
 * @author @Dog_E
 * @date 2020-08-28
 */
@Service
public class OwnResHouseRoomConfServiceImpl extends ServiceImpl<OwnResHouseRoomConfMapper,OwnResHouseRoomConf> implements IOwnResHouseRoomConfService
{
    @Autowired
    private OwnResHouseRoomConfMapper ownResHouseRoomConfMapper;

    /**
     * 查询房间配置
     * 
     * @param id 房间配置ID
     * @return 房间配置
     */
    @Override
    public OwnResHouseRoomConf selectOwnResHouseRoomConfById(Long id)
    {
        return ownResHouseRoomConfMapper.selectOwnResHouseRoomConfById(id);
    }

    /**
     * 查询房间配置列表
     * 
     * @param ownResHouseRoomConf 房间配置
     * @return 房间配置
     */
    @Override
    public List<OwnResHouseRoomConf> selectOwnResHouseRoomConfList(OwnResHouseRoomConf ownResHouseRoomConf)
    {
        return ownResHouseRoomConfMapper.selectOwnResHouseRoomConfList(ownResHouseRoomConf);
    }

    /**
     * 新增房间配置
     * 
     * @param ownResHouseRoomConf 房间配置
     * @return 结果
     */
    @Override
    public int insertOwnResHouseRoomConf(OwnResHouseRoomConf ownResHouseRoomConf)
    {
        ownResHouseRoomConf.setCreateTime(DateUtils.getNowDate());
        return ownResHouseRoomConfMapper.insertOwnResHouseRoomConf(ownResHouseRoomConf);
    }

    /**
     * 修改房间配置
     * 
     * @param ownResHouseRoomConf 房间配置
     * @return 结果
     */
    @Override
    public int updateOwnResHouseRoomConf(OwnResHouseRoomConf ownResHouseRoomConf)
    {
        ownResHouseRoomConf.setUpdateTime(DateUtils.getNowDate());
        return ownResHouseRoomConfMapper.updateOwnResHouseRoomConf(ownResHouseRoomConf);
    }

    /**
     * 批量删除房间配置
     * 
     * @param ids 需要删除的房间配置ID
     * @return 结果
     */
    @Override
    public int deleteOwnResHouseRoomConfByIds(Long[] ids)
    {
        return ownResHouseRoomConfMapper.deleteOwnResHouseRoomConfByIds(ids);
    }

    /**
     * 删除房间配置信息
     * 
     * @param id 房间配置ID
     * @return 结果
     */
    @Override
    public int deleteOwnResHouseRoomConfById(Long id)
    {
        return ownResHouseRoomConfMapper.deleteOwnResHouseRoomConfById(id);
    }
}
